<script setup lang="ts">
import {reactive, ref} from "vue";
import {test1, test2, test3} from "../network/api.ts";

//
// let url = "http://localhost:8080"
//
// let urlRec= "/FoodController/listFoodByBusinessId/"
// let type = 10001
// axios.get(url.concat(urlRec,type))
//     .then(res=>{
//       console.log("res.data = ")
//       console.log(res.data)
//     })
//     .catch(error=>{
//       console.log(error)
//     })

//get方法测试  后端@PathVariable
let businessid = ref(10001)
test1(businessid.value).then(res=>{
  console.log(res.data)
})
//post方法测试  后端@RequestParam
let user = reactive({
  id:"1",
  pw:"1"
})
test2(user).then(res=>{
  console.log(res.data)
})

let cart = reactive({
  uid:"123",
  bid:10001,
})
test3(cart).then(res=>{
  console.log(res.data)
})
</script>

<template>
  <el-button type="primary">Primary</el-button>
</template>

<style scoped>

</style>